import request from '@/utils/request'

let jizhangbenApi = {
  // 通过账单类型的名字查询账单字段配置
  getFieldsByName(id){
    return request({
      url: `/tallyBookType/${id}`,
      method: 'get'
    })
  },
    // 列表
    getTallyBookList(data) {
        return request({
          url: '/tallyBook/list',
          method: 'get',
          params:data
        })
      },
    //   新增
      addTallyBook(data) {
        return request({
          url: '/tallyBook',
          method: 'post',
          data:data
        })
      },
    //   编辑
    editTallyBook(data) {
        return request({
          url: '/tallyBook',
          method: 'put',
          data:data
        })
      },
    //   删除
    delTallyBook(ids) {
        return request({
          url: `/tallyBook/${ids}`,
          method: 'delete'
        })
      },
    //   查询
    tallyBookInfoById(id) {
        return request({
          url: `/tallyBook/${id}`,
          method: 'get'
        })
      },
    //   导出
    tallyBookExport(params) {
        return request({
          url: `/tallyBook/export`,
          method: 'get',
          responseType: 'blob',
          params
        })
      },

    //   账单类型列表
    getTypeList(data) {
        return request({
          url: '/tallyBookType/list',
          method: 'get',
          params:data
        })
      },
    // 账单类型新增
    addType(data) {
        return request({
          url: '/tallyBookType',
          method: 'post',
          data:data
        })
      },
    // 账单类型编辑
    editType(data) {
        return request({
          url: '/tallyBookType',
          method: 'put',
          data:data
        })
      },
    // 账单类型删除
    delType(ids) {
        return request({
          url: `/tallyBookType/${ids}`,
          method: 'delete'
        })
      },
 
}
export default jizhangbenApi

